package com.cancan.cloud.shop.enums;

/**
 * @author ZhouFufeng
 * @since 2020/4/22
 **/
public enum GatewayEnum {

    UNAUTHORIZED(401, "未提供token认证信息"),

    FORBIDDEN(403, "token校验失败，禁止访问"),

    URL_WHITE_NULL(10001,"过滤白名单为空");

    private int code;
    private String message;

    private GatewayEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return this.message;
    }

    public String getMessage(String message) {
        return String.format(this.message, message == null ? "" : message);
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
